﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BL
{
    public class Message
    {

        public Message()
        {

        }

        public Message(int messagetypeId, DateTime lastChanged, int prio, string messageBody , tUser usr, tDevice dev)
        {
            this.messageTypeId = messagetypeId;
            this.lastChange = lastChanged;
            this.prio = prio;
            this.messageBody = messagetypeId.ToString("0000") + ';' + messageBody;
            this.userId = usr.userId;
            this.deviceId = dev.deviceId;
            this.password = usr.password;
        }

        private int messageTypeId;

        public int MessageTypeId
        {
            get { return messageTypeId; }
        }

        private int userId;

        private string password;

        private string deviceId;

        public string DeviceId
        {
            get { return deviceId; }
        }

        private int prio;

        private DateTime lastChange;

        public DateTime LastChange
        {
            get { return lastChange; }
        }

        private string messageBody;

        public override string ToString()
        {
            return messageBody;
        }

        public Message(string message)
        {
            this.messageBody = message;
        }

        public static void saveMessages(List<Message> listOfMessages)
        {
            
        }

    }
}
